Dynomotion

Group: DynoMotion Message: 2321 From: himykabibble Date: 11/18/2011
Subject: Mach3 Init Options Working Right?
Using Mach3 v53, I've disabled the option to "Initialize On Every Mach Reset". But, my Init program is still be run every time I toggle the Mach3 E-Stop, which is clobbering my limit handling logic. Is this working correctly?

Regards,
Ray L.
Group: DynoMotion Message: 2322 From: Tom Kerekes Date: 11/18/2011
Subject: Re: Mach3 Init Options Working Right?
 
Hi Ray,
 
There was a bug.  Here is a patch.  Copy to the Mach3 Plugins Directory.
 
 
Although I'm not sure how much sense that option really makes.  I guess I don't understand the issue.
 
Regards
TK
 

Group: DynoMotion Message: 2323 From: himykabibble Date: 11/18/2011
Subject: Re: Mach3 Init Options Working Right?
Tom,

Thanks. The issue I'm having is my limit logic is in a while(1) loop at the end of my init program. When I hit a limit, it triggers an E-Stop, and coming out of E-Stop runs init, which re-initializes, and clears the limit. I suppose I could move the limit code to a stand-alone thread, but it works nicely where it is, except for this. If I wanted to move it to a stand-alone thread, how do I get that thread started, since it seems all the existing programs are executed by some external stimulus (M-code execution, spindle command, etc.)? I imagine I could launch it using StartThread, but how do I prevent it from getting re-launched when the init thread is run again, which would leave me where I am now?

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
>  
> Hi Ray,
>  
> There was a bug.  Here is a patch.  Copy to the Mach3 Plugins Directory.
>  
> http://dynomotion.com/Software/Patch/Dynomotion.dll
>  
> Although I'm not sure how much sense that option really makes.  I guess I don't understand the issue.
>  
> Regards
> TK
>  
>
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Friday, November 18, 2011 6:49 PM
> Subject: [DynoMotion] Mach3 Init Options Working Right?
>
>
>  
> Using Mach3 v53, I've disabled the option to "Initialize On Every Mach Reset". But, my Init program is still be run every time I toggle the Mach3 E-Stop, which is clobbering my limit handling logic. Is this working correctly?
>
> Regards,
> Ray L.
>
Group: DynoMotion Message: 2324 From: Tom Kerekes Date: 11/18/2011
Subject: Re: Mach3 Init Options Working Right?
Hi Ray,
 
How about if you use some persist.UserData Vars to maintain your state from execution to execution?
 
BTW there isn't really a way to download programs to other Threads on startup/reset.  So far we haven't run across a case that needed it.
 
Regards
TK

Group: DynoMotion Message: 2326 From: himykabibble Date: 11/18/2011
Subject: Re: Mach3 Init Options Working Right?
Tom,

I think that may have broken something else.... I have an on-screen button to over-ride the limits. It sends a notify message 10000. With the 428x plug-in, that button always works properly (I have a printf so I can see each time it executes). But with the new plug-in, the button no longer works after the first limit is triggered - there appears to be no notify message getting to the handler (the first few lines of the handler are your example, that picks up the notify ID and prints it to the console, and that message never comes out).

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
>  
> Hi Ray,
>  
> There was a bug.  Here is a patch.  Copy to the Mach3 Plugins Directory.
>  
> http://dynomotion.com/Software/Patch/Dynomotion.dll
>  
> Although I'm not sure how much sense that option really makes.  I guess I don't understand the issue.
>  
> Regards
> TK
>  
>
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Friday, November 18, 2011 6:49 PM
> Subject: [DynoMotion] Mach3 Init Options Working Right?
>
>
>  
> Using Mach3 v53, I've disabled the option to "Initialize On Every Mach Reset". But, my Init program is still be run every time I toggle the Mach3 E-Stop, which is clobbering my limit handling logic. Is this working correctly?
>
> Regards,
> Ray L.
>
Group: DynoMotion Message: 2327 From: himykabibble Date: 11/18/2011
Subject: Re: Mach3 Init Options Working Right?
Tom,

Well, then there's the problem of figuring out when you REALLY need to do a full init, including those persist vars....

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
>  
> How about if you use some persist.UserData Vars to maintain your state from execution to execution?
>  
> BTW there isn't really a way to download programs to other Threads on startup/reset.  So far we haven't run across a case that needed it.
>  
> Regards
> TK
>
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Friday, November 18, 2011 8:46 PM
> Subject: [DynoMotion] Re: Mach3 Init Options Working Right?
>
>
>  
> Tom,
>
> Thanks. The issue I'm having is my limit logic is in a while(1) loop at the end of my init program. When I hit a limit, it triggers an E-Stop, and coming out of E-Stop runs init, which re-initializes, and clears the limit. I suppose I could move the limit code to a stand-alone thread, but it works nicely where it is, except for this. If I wanted to move it to a stand-alone thread, how do I get that thread started, since it seems all the existing programs are executed by some external stimulus (M-code execution, spindle command, etc.)? I imagine I could launch it using StartThread, but how do I prevent it from getting re-launched when the init thread is run again, which would leave me where I am now?
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> >  
> > Hi Ray,
> >  
> > There was a bug.  Here is a patch.  Copy to the Mach3 Plugins Directory.
> >  
> > http://dynomotion.com/Software/Patch/Dynomotion.dll
> >  
> > Although I'm not sure how much sense that option really makes.  I guess I don't understand the issue.
> >  
> > Regards
> > TK
> >  
> >
> > From: himykabibble <jagboy@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Friday, November 18, 2011 6:49 PM
> > Subject: [DynoMotion] Mach3 Init Options Working Right?
> >
> >
> >  
> > Using Mach3 v53, I've disabled the option to "Initialize On Every Mach Reset". But, my Init program is still be run every time I toggle the Mach3 E-Stop, which is clobbering my limit handling logic. Is this working correctly?
> >
> > Regards,
> > Ray L.
> >
>
Group: DynoMotion Message: 2328 From: Tom Kerekes Date: 11/18/2011
Subject: Re: Mach3 Init Options Working Right?
Hi Ray,
 
Could you describe the sequence of events you are testing?  One you have Estop other things probably wont happen until things are re-initialized and enabled.
 
Regards
TK

Group: DynoMotion Message: 2329 From: Tom Kerekes Date: 11/18/2011
Subject: Re: Mach3 Init Options Working Right?
Hi Ray,
 
Not really sure what you mean, but those variables are zeroed on power up so you can use that to initialize to an unkown state or to whatever you derive from inputs.  After that the state should be maintained forever based on what happened.   That is the best you can logically do right?
 
Regards
TK

Group: DynoMotion Message: 2332 From: himykabibble Date: 11/18/2011
Subject: Re: Mach3 Init Options Working Right?
Tom,

Here's what I'm doing, and it works perfectly under KMotionCNC:

I initialize the LimitOptions to 0. I have a loop in my Init that monitors the limit input, debounces it, and if it goes active, then it looks to see which axis is moving, and in which direction (actually, right now, I'm only acting on the Z axis). When it finds an axis moving, it sets the LimitOptions for that axis to Disallow for that axis, and that direction only, then sets the "virtual limit" output. Your limit logic then stops the axis, and disables it. That is all working fine under both KMCMC and Mach3. Now, to get out of this state, I have an on-screen button that sets an "over-ride" flag, and re-enables the axis, so I can jog off the limit. That part works fine under KMCNC, but not Mach3. In Mach3, the button does nothing more than "NotifyPlugins(10000)", and the Notify handler sets the flag and enables the axis. But, after the limit has been tripped, the machine has E-stopped, then been taken out of E-Stop, the Noyify handler is not getting invoked when I click the button. It DOES get invoked correctly before the limit trip occurs. It doesn't make much sense, but that is what's I'm seeing here.

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
>  
> Could you describe the sequence of events you are testing?  One you have Estop other things probably wont happen until things are re-initialized and enabled.
>  
> Regards
> TK
>
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Friday, November 18, 2011 9:10 PM
> Subject: [DynoMotion] Re: Mach3 Init Options Working Right?
>
>
>  
> Tom,
>
> I think that may have broken something else.... I have an on-screen button to over-ride the limits. It sends a notify message 10000. With the 428x plug-in, that button always works properly (I have a printf so I can see each time it executes). But with the new plug-in, the button no longer works after the first limit is triggered - there appears to be no notify message getting to the handler (the first few lines of the handler are your example, that picks up the notify ID and prints it to the console, and that message never comes out).
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> >  
> > Hi Ray,
> >  
> > There was a bug.  Here is a patch.  Copy to the Mach3 Plugins Directory.
> >  
> > http://dynomotion.com/Software/Patch/Dynomotion.dll
> >  
> > Although I'm not sure how much sense that option really makes.  I guess I don't understand the issue.
> >  
> > Regards
> > TK
> >  
> >
> > From: himykabibble <jagboy@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Friday, November 18, 2011 6:49 PM
> > Subject: [DynoMotion] Mach3 Init Options Working Right?
> >
> >
> >  
> > Using Mach3 v53, I've disabled the option to "Initialize On Every Mach Reset". But, my Init program is still be run every time I toggle the Mach3 E-Stop, which is clobbering my limit handling logic. Is this working correctly?
> >
> > Regards,
> > Ray L.
> >
>
Group: DynoMotion Message: 2334 From: himykabibble Date: 11/18/2011
Subject: Re: Mach3 Init Options Working Right?
Tom,

OK, I'll make use of that, and see what I can come up with.

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
>  
> Not really sure what you mean, but those variables are zeroed on power up so you can use that to initialize to an unkown state or to whatever you derive from inputs.  After that the state should be maintained forever based on what happened.   That is the best you can logically do right?
>  
> Regards
> TK
>
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Friday, November 18, 2011 9:14 PM
> Subject: [DynoMotion] Re: Mach3 Init Options Working Right?
>
>
>  
> Tom,
>
> Well, then there's the problem of figuring out when you REALLY need to do a full init, including those persist vars....
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ray,
> >  
> > How about if you use some persist.UserData Vars to maintain your state from execution to execution?
> >  
> > BTW there isn't really a way to download programs to other Threads on startup/reset.  So far we haven't run across a case that needed it.
> >  
> > Regards
> > TK
> >
> > From: himykabibble <jagboy@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Friday, November 18, 2011 8:46 PM
> > Subject: [DynoMotion] Re: Mach3 Init Options Working Right?
> >
> >
> >  
> > Tom,
> >
> > Thanks. The issue I'm having is my limit logic is in a while(1) loop at the end of my init program. When I hit a limit, it triggers an E-Stop, and coming out of E-Stop runs init, which re-initializes, and clears the limit. I suppose I could move the limit code to a stand-alone thread, but it works nicely where it is, except for this. If I wanted to move it to a stand-alone thread, how do I get that thread started, since it seems all the existing programs are executed by some external stimulus (M-code execution, spindle command, etc.)? I imagine I could launch it using StartThread, but how do I prevent it from getting re-launched when the init thread is run again, which would leave me where I am now?
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > >  
> > > Hi Ray,
> > >  
> > > There was a bug.  Here is a patch.  Copy to the Mach3 Plugins Directory.
> > >  
> > > http://dynomotion.com/Software/Patch/Dynomotion.dll
> > >  
> > > Although I'm not sure how much sense that option really makes.  I guess I don't understand the issue.
> > >  
> > > Regards
> > > TK
> > >  
> > >
> > > From: himykabibble <jagboy@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Friday, November 18, 2011 6:49 PM
> > > Subject: [DynoMotion] Mach3 Init Options Working Right?
> > >
> > >
> > >  
> > > Using Mach3 v53, I've disabled the option to "Initialize On Every Mach Reset". But, my Init program is still be run every time I toggle the Mach3 E-Stop, which is clobbering my limit handling logic. Is this working correctly?
> > >
> > > Regards,
> > > Ray L.
> > >
> >
>
Group: DynoMotion Message: 2336 From: Tom Kerekes Date: 11/18/2011
Subject: Re: Mach3 Init Options Working Right?
Hi Ray,
 
I don't know what you mean by the statement " then been taken out of E-Stop".
 
Does that mean push RESET?
 
Because until the machine is reset I don't think Mach3 will allow VB to run so your button will be ignored.
 
Regards
TK